<template>
	<view class="">
		<view class="sc">
			<view class="scdp" v-for="(item,index) in storeList" :key="index">
				<view class="scdp_left">
					<image style="width: 100%;height: 140rpx;" :src="item.store_id.image" mode=""></image>
				</view>
				<view class="scdp_main">
					<view class="" style="display: flex;">
						<view class="" style="padding: 10rpx;">
							{{item.store_id.store_name}}
						</view>
						<view v-if="item.store_id.is_open == 0" class="" style="padding: 10rpx;font-size: 28rpx;color: #ccc;">
							暂停营业
						</view>
						<view v-if="item.store_id.is_open == null" class="" style="padding: 10rpx;font-size: 28rpx;color: #ccc;">
							暂停营业
						</view>
						<view v-if="item.store_id.is_open == 1" class="" style="padding: 10rpx;font-size: 28rpx;color: #ccc;">
							营业中
						</view>
					</view>
					<view class="" style="padding: 10rpx;">
						营业时间: {{item.store_id.start_time}} - {{item.store_id.end_time}}
					</view>
					<view class="" style="padding: 10rpx;font-size: 28rpx;color: #ccc; ">
						10公里内10元起送
					</view>
					
				</view>
				<view class="scdp_right" @click="nosc(item)">
					<view class="" style="border: 1rpx solid #ccc;">
						删除
					</view>
				</view>
			</view>
			
			
		</view>
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				storeList:[],
				storeId:'',
			}
		},
		onShow() {
			this.getStoreList()
		},
		methods:{
			// storeShoucList
			getStoreList(){
				this.$req('GET',this.$api.storeShoucList,{
					user_id:uni.getStorageSync('userId')
				}).then(res =>{
					this.storeList = res.data.list
					
					
				})
			},
			// nosc(){
				
			// },
			nosc(item){
				this.storeId = item.store_id.id
				console.log(item,'查看item是什么')
				this.$req('POST',this.$api.setCollect,{
					user_id:uni.getStorageSync('userId'),
					store_id:this.storeId
					
				}).then(res =>{
					console.log(res,'收藏取消收藏成功')
					// this.collect = 0
					this.getStoreList()
				})
				
				console.log(item.store_id.id,'查看这个id是多少')
				
				
			},
			
			
		}
		
	}
	
	
</script>

<style>
	page {
		background: #f6f5f7;
	}
	
	
	.sc{
		width: 100%;
		height: 1000rpx;
		overflow-y: scroll;
	}
	
	.scdp{
		width: 95%;
		background-color: #fff;
		margin: 20rpx auto;
		display: flex;
		border-radius: 10rpx;
	}
	
	.scdp_left{
		width: 20%;
		/* height: 130rpx; */
		padding: 10rpx;
	}
	
	.scdp_main{
		width: 65%;
	}
	
	.scdp_right{
		width: 15%;
		text-align: center;
		
	}
	
</style>